
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ts-declaration-location
Advanced tools
Any donations would be much appreciated. 😄
ts-declaration-location
is available as part of the Tidelift Subscription.
Tidelift is working with the maintainers of ts-declaration-location
and a growing network of open source maintainers
to ensure your open source software supply chain meets enterprise standards now and into the future.
Learn more.
# Install with npm
npm install ts-declaration-location
# Install with pnpm
pnpm add ts-declaration-location
# Install with yarn
yarn add ts-declaration-location
# Install with bun
`bun add ts-declaration-location
# Install in a node project
npx jsr add @rebeccastevens/ts-declaration-location
# Install in a deno project
deno add jsr:@rebeccastevens/ts-declaration-location
# Install in a bun project
bunx jsr add @rebeccastevens/ts-declaration-location
import typeMatchesSpecifier from "ts-declaration-location";
import type ts from "typescript";
function isTypeFromSomePackage(program: ts.Program, type: ts.Type) {
const specifier = {
from: "package",
package: "some-package",
};
return typeMatchesSpecifier(program, specifier, type);
}
function isTypeFromSomeFile(program: ts.Program, type: ts.Type) {
const specifier = {
from: "file",
path: "src/**/some.ts",
};
return typeMatchesSpecifier(program, specifier, type);
}
function isTypeFromTSLib(program: ts.Program, type: ts.Type) {
const specifier = {
from: "lib",
};
return typeMatchesSpecifier(program, specifier, type);
}
FAQs
Determine where a ts type declaration comes from
The npm package ts-declaration-location receives a total of 244,559 weekly downloads. As such, ts-declaration-location popularity was classified as popular.
We found that ts-declaration-location demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.